home *** CD-ROM | disk | FTP | other *** search
- /*
- File: Power.h
-
- Copyright: © 1984-1993 by Apple Computer, Inc., all rights reserved.
-
- WARNING
- This file was auto generated by the interfacer tool. Modifications
- must be made to the master file.
-
- */
-
- #ifndef __POWER__
- #define __POWER__
-
- #ifndef __TYPES__
- #include <Types.h>
- /* #include <ConditionalMacros.h> */
- /* #include <MixedMode.h> */
- /* #include <Traps.h> */
- #endif
-
- enum {
- /* Bit positions for ModemByte */
- modemOnBit = 0,
- ringWakeUpBit = 2,
- modemInstalledBit = 3,
- ringDetectBit = 4,
- modemOnHookBit = 5,
- /* masks for ModemByte */
- modemOnMask = 0x1,
- ringWakeUpMask = 0x4,
- modemInstalledMask = 0x8,
- ringDetectMask = 0x10,
- modemOnHookMask = 0x20,
- /* bit positions for BatteryByte */
- chargerConnBit = 0,
- hiChargeBit = 1,
- chargeOverFlowBit = 2,
- batteryDeadBit = 3,
- batteryLowBit = 4,
- connChangedBit = 5,
- /* masks for BatteryByte */
- chargerConnMask = 0x1,
- hiChargeMask = 0x2,
- chargeOverFlowMask = 0x4,
- batteryDeadMask = 0x8
- };
-
- enum {
- batteryLowMask = 0x10,
- connChangedMask = 0x20,
- /* commands to SleepQRec sleepQProc */
- sleepRequest = 1,
- sleepDemand = 2,
- sleepWakeUp = 3,
- sleepRevoke = 4,
- /* SleepQRec.sleepQFlags */
- noCalls = 1,
- noRequest = 2,
- slpQType = 16,
- sleepQType = 16
- };
-
- typedef char ModemByte;
-
- typedef char BatteryByte;
-
- typedef long PMResultCode;
-
- typedef struct SleepQRec SleepQRec, *SleepQRecPtr;
-
-
- /*
- SleepQProcs cannot be written in or called from a high-level
- language without the help of mixed mode or assembly glue because they
- use the following parameter-passing convention:
-
- typedef pascal long (*SleepQProcPtr)(long message, SleepQRecPtr qRecPtr);
-
- In:
- => message D0.L
- => qRecPtr A0.L
- Out:
- <= long D0.L
- */
-
- enum {
- uppSleepQProcInfo = kRegisterBased|RESULT_SIZE(kFourByteCode)|REGISTER_RESULT_LOCATION(kRegisterD0)|REGISTER_ROUTINE_PARAMETER(1,kRegisterD0,kFourByteCode)|REGISTER_ROUTINE_PARAMETER(2,kRegisterA0,kFourByteCode)
- };
-
- #if USESROUTINEDESCRIPTORS
- typedef pascal long (*SleepQProcPtr)(long message, SleepQRecPtr qRecPtr);
-
- typedef UniversalProcPtr SleepQUPP;
-
- #define CallSleepQProc(userRoutine, message, qRecPtr) \
- CallUniversalProc((UniversalProcPtr)(userRoutine), (uppSleepQProcInfo), (cbNeeded))
-
- #define NewSleepQProc(userRoutine) \
- (SleepQUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppSleepQProcInfo, GetCurrentISA())
-
- #else
- typedef ProcPtr SleepQUPP;
-
- #define NewSleepQProc(userRoutine) \
- (SleepQUPP)(userRoutine)
-
- #endif
-
- #if defined(powerc) || defined (__powerc)
- #pragma options align=mac68k
- #endif
- struct SleepQRec {
- struct SleepQRec *sleepQLink;
- short sleepQType; /*type = 16*/
- SleepQUPP sleepQProc; /*Pointer to sleep universal proc ptr*/
- short sleepQFlags;
- };
- #if defined(powerc) || defined(__powerc)
- #pragma options align=reset
- #endif
-
- #ifdef __cplusplus
- extern "C" {
- #endif
-
- extern pascal OSErr DisableWUTime(void);
- extern pascal OSErr GetWUTime(long *WUTime, Byte *WUFlag);
- extern pascal OSErr SetWUTime(long WUTime);
- extern pascal OSErr BatteryStatus(Byte *Status, Byte *Power);
- extern pascal OSErr ModemStatus(Byte *Status);
-
- #if USES68KINLINES
- #pragma parameter __D0 IdleUpdate
- #endif
- extern pascal long IdleUpdate(void)
- ONEWORDINLINE(0xA285);
-
- #if USES68KINLINES
- #pragma parameter __D0 GetCPUSpeed
- #endif
- extern pascal long GetCPUSpeed(void)
- TWOWORDINLINE(0x70FF, 0xA485);
- extern pascal void EnableIdle(void)
- TWOWORDINLINE(0x7000, 0xA485);
- extern pascal void DisableIdle(void)
- TWOWORDINLINE(0x7001, 0xA485);
-
- #if USES68KINLINES
- #pragma parameter SleepQInstall(__A0)
- #endif
- extern pascal void SleepQInstall(SleepQRecPtr qRecPtr)
- ONEWORDINLINE(0xA28A);
-
- #if USES68KINLINES
- #pragma parameter SleepQRemove(__A0)
- #endif
- extern pascal void SleepQRemove(SleepQRecPtr qRecPtr)
- ONEWORDINLINE(0xA48A);
- extern pascal void AOn(void)
- TWOWORDINLINE(0x7004, 0xA685);
- extern pascal void AOnIgnoreModem(void)
- TWOWORDINLINE(0x7005, 0xA685);
- extern pascal void BOn(void)
- TWOWORDINLINE(0x7000, 0xA685);
- extern pascal void AOff(void)
- TWOWORDINLINE(0x7084, 0xA685);
- extern pascal void BOff(void)
- TWOWORDINLINE(0x7080, 0xA685);
- #ifdef __cplusplus
- }
- #endif
-
- #endif
-
-